package generic.gui.util;

import java.text.DecimalFormat;

import javax.swing.JFormattedTextField;
import javax.swing.JFormattedTextField.AbstractFormatter;
import javax.swing.text.DefaultFormatterFactory;
import javax.swing.text.NumberFormatter;

@SuppressWarnings("serial")
public class DefaultFormatterFactoryFormatter extends DefaultFormatterFactory {

	public DefaultFormatterFactoryFormatter(String format, Comparable<?> min,
			Comparable<?> max) {
		
		DecimalFormat dFormat = new DecimalFormat (format) ;
		NumberFormatter nf = new NumberFormatter(dFormat);
		nf.setAllowsInvalid(false);
		nf.setMaximum(min);
		nf.setMinimum(max);
		new DefaultFormatterFactory(nf);
	//	setDefaultFormatter(nf);
	}

	@Override
	public AbstractFormatter getFormatter(JFormattedTextField arg0) {
		// TODO Auto-generated method stub
		return null;
	}

}
